Property | Description |
BarcodeType | Gets and sets the type of barcode to create from the BarcodeType enumeration. |
BarcodeValue | Gets and sets the value of the barcode to be created. |
BarcodeData | Gets and sets the current barcode value as an array of bytes used only if non-ASCII text values are needed. |
Method | Description |
Create | The main method for creating barcodes. |
CreateBitmap | Creates bitmap barcodes. |
C# - Basic steps for barcode writing 1D barcodes using Accusoft.BarcodeXpress.Net |
Copy Code |
---|---|
//create and unlock the BarcodeXpress component BarcodeXpress bcx = new BarcodeXpress(); // The SetSolutionName and SetSolutionKey methods must be called to distribute the runtime. bcx.Licensing.SetSolutionName("YourSolutionName"); bcx.Licensing.SetSolutionKey(12345,12345,12345,12345); // The SetOEMLicenseKey method is required if Manually Reported Runtime Licensing is used. bcx.Licensing.SetOEMLicenseKey("1.0.AStringForOEMLicensing"); //set the required writer properties bcx.writer.BarcodeType = BarcodeType.Code39Barcode; bcx.writer.BarcodeValue = "CODE39"; //call Create and get resulting image imageXView1.Image = Accusoft.ImagXpressSdk.ImageX.FromHdib(imagXpress1, bcx.writer.Create()); // dispose of the barcode component bcx.Dispose(); |
1D barcode values are generally 7 bit ASCII, except for Code 128, which permits the use of 8 bit data. If you are using values above 127, you must use the BarcodeDataAsByte property of the Result class instead of the BarcodeValue property, and your data must be encoded. Also, the reader and writer must both use the same character set.
For writing 1D barcode, Code 128, using encoded 8859-15 |
Copy Code |
---|---|
//set the required writer properties System.Text.Encoding iso = System.Text.Encoding.GetEncoding("ISO-8859-15"); bcx.writer.BarcodeData = iso.GetBytes("€27.99"); |